﻿using System;

/*
 * Write a program that gets a number n and after that gets more n numbers and calculates and prints their sum. 
 */

class SumOfNNumbers
{
    static void Main(string[] args)
    {
        int membersToSum;
        do
        {
            Console.WriteLine("Enther the amount of numbers that you would like to sum:");

        }
        while (!int.TryParse(Console.ReadLine(), out membersToSum));

        double sum = 0.0;
        for (int i = 1; i <= membersToSum; i++)
		{
            double enteredNumber;
            do
            {
                Console.WriteLine("Enter number {0}:",i);
            } while (!double.TryParse(Console.ReadLine(), out enteredNumber));

            sum += enteredNumber;
		};

        Console.WriteLine("The sum of the entered {0} numbers is : {1}",membersToSum,sum );
    }
}
